import request from '@/common/request.js'

//用户查看个人充值信息
const getOwnRechargeInfo = (data) => {
	const url = '8184/campusFee/getRechargeRecords';
	return request.globalRequest(url,'get',null, 1)
}

//获取统计信息
const getStatic = (data) => {
	const url = '8184/campusFee/getStatistics';
	return request.globalRequest(url,'post',data, 1)
}

//获取剩余电量信息
const getUnUseElectricity=(data)=>{
	const url='8184/campusFee/getElectricity';
	return request.globalRequest(url,'get',data,1);
}

//获取今日用用水量信息
const getUsewater=(data)=>{
	const url='8184/campusFee/getTodayUsage';
	return request.globalRequest(url,'get',data,1);
}


const insertWaterFee = (fee) => {
	const url = `8184/campusFee/insertWaterFee?fee=${fee}`;
	return request.globalRequest(url, 'post', {}, 1)
};

const insertElectricityFee = (fee) => {
	const url = `8184/campusFee/insertElectronicFee?fee=${fee}`;
	return request.globalRequest(url, 'post', {}, 1)
};
//充值校园卡
const insertCampusCard=(fee)=>{
	const url = `8184/campusFee/insertCampusCard?fee=${fee}`;
	return request.globalRequest(url, 'post', {}, 1)
}

//获取校园卡余额
const getBalence=(data)=>{
	const url='8184/campusCard/getBalance';
	return request.globalRequest(url,'get',data,1);
}

const getTotalYearFee = (type) => {
	const url = `8184/campusFee/getWaterTotalFee?type=${type}`;
	return request.globalRequest(url, 'get', {}, 1)
};


export default {
  getOwnRechargeInfo,
  getStatic,
  getUnUseElectricity,
  getUsewater,
  insertWaterFee,
  insertElectricityFee,
  insertCampusCard,
  getBalence,
  getTotalYearFee
};
